<template>
  <el-submenu :index="menu.router">
    <template slot="title">{{menu.name}}</template>
    <template  v-for="item in menu.list">
      <el-menu-item v-if="item.list==null" :index="item.router">{{item.name}}</el-menu-item>
      <sub-item v-else v-bind:menu="item"/>
    </template>
  </el-submenu>

</template>

<script>
  //用于递归生成菜单
  export default {
    name: 'SubItem',
    props:{
      menu: {
        type: Object,
        default(){
          return {};
        }
      }
    },
    mounted(){

    },
    created(){

    },
    data () {
      return {
      }
    }
  }
</script>

<style scoped>

</style>
